/*
 * Name:	TestSet.java
 * Lesson:	Day10	Set
 * Notice:	ע�⿴���Ľ��4���Set�ӿ��Լ��ӿ�ʵ���������
 */
package corej.course.collection.set;

import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class TestSet {

    @SuppressWarnings("unchecked")
    public static void main(String[] args) {
        Set s = new HashSet();
        String s1 = new String("Liucy");
        String s2 = new String("Hiloo");
        String s3 = new String("Huxz");
        String s4 = new String("Liucy");

        s.add(s1);
        s.add(s2);
        s.add(s3);
        s.add(s4);

        print(s);
    }

    public static void print(Collection c) {
        Iterator it = c.iterator();
        while (it.hasNext()) {
            Object o = it.next();
            System.out.println(o);
        }
    }
}
